home *** CD-ROM | disk | FTP | other *** search
/ The 640 MEG Shareware Studio 2 / The 640 Meg Shareware Studio CD-ROM Volume II (Data Express)(1993).ISO / ss / nohead10.zip / NOHEAD.DOC next >
Text File  |  1992-01-05  |  6KB  |  121 lines

  1. NOHEAD.EXE  v1.0
  2.   by James C. Hendee
  3.  
  4.      The need for this program arose out of the usual hassle required 
  5. to edit columnar data files produced by such programs as Lotus, 
  6. Quattro Pro or Excel to accommodate easy import of the data into other 
  7. spreadsheets, database managers, graphics or statistics packages.  
  8. Although most spreadsheets will import worksheets produced by other 
  9. spreadsheets, others will not.  They usually will, however, import 
  10. comma-delimited or SDF (system data or space-delimited format) files, 
  11. if the tops of the columns aren't cluttered with column headings and 
  12. descriptions (the header).  dBase III+ and IV will import either 
  13. comma-delimited or space delimited data into a .DBF structure, but 
  14. again, any header info will make the first several records (equal to 
  15. the number of header lines) unusable.  
  16.  
  17.      NOHEAD will make two new files from your original data file:  a 
  18. file with your header information, and a data file.  The data file 
  19. will have either comma or space delimiters, or will be identical to 
  20. the original data file, minus the header.  There should be no blank 
  21. entries in your original data file, or the resulting data file may be 
  22. unusable (try it and you'll see why).  You must know the number of 
  23. lines in the header of your original data file for the program to work 
  24. correctly, and you must use unique names for all three file names.  If 
  25. you use an input file name that doesn't exist, or if you input an 
  26. already existing file name that NOHEAD can't open (e.g., a read-only 
  27. file), you'll get an error message (all errors return an errorlevel of 
  28. 1).  The header can be of any length, which means you can also use 
  29. NOHEAD to split large ASCII files of any type into whatever sizes you 
  30. want (each line must end in a carriage return, however).  You could 
  31. therefore split files produced by NOHEAD into other split files--use 
  32. the -t option described below if you don't want the data structure 
  33. changed.  
  34.  
  35.      Command line usage at the system prompt:
  36.  
  37. nohead -|/c|s|t input.dat header.txt data.txt 6
  38.  
  39. Switches are:  -c or /c      comma-delimited
  40.                -s or /s      space-delimited
  41.                -t or /t      original tabular form
  42.  
  43. Parameters:    input.dat     original data file
  44.                header.txt    file name for the produced header file
  45.                data.txt      file name for the produced data file
  46.                6             number of header lines in the input.txt
  47.  
  48.      For example, if you had a spreadsheet file of oceanographic 
  49. nutrient values taken from the northern Gulf of Mexico, and you 
  50. printed the data to an ASCII file called NUTS.DAT, which had 5 lines 
  51. of text (header) at the top, you could use the following command line 
  52. to produce the header file HEAD.DOC and a comma-delimited file called 
  53. DATA.CMA:
  54.  
  55. NOHEAD /C NUTS.DAT HEAD.DOC DATA.CMA 5
  56.  
  57.      The original data file (NUTS.DAT) would look like this:
  58.  
  59. Nutrient Data from the Northern Gulf of Mexico.
  60. =======================================================================
  61.        Potent.
  62.  Depth   Temp.    Sal.     O2     NH4     PO4      Si     NO3     NO2
  63. -----------------------------------------------------------------------
  64.      2    29.48  30.287   4.695    0.09    0.02    1.87    0.11       0
  65.      4    29.48  31.513    4.63    0.08    0.01    1.97    0.16       0
  66.      6    29.61  33.393    4.61    0.15    0.02    2.21    0.16       0
  67.      7    29.59  33.937   4.611    0.09    0.02    2.39    0.21       0
  68.     10    29.12  34.414    4.58    0.05    0.02    2.39    0.21       0
  69.  
  70. but your comma-delimited file (DATA.CMA) would look like this,
  71.  
  72. 2,29.48,30.287,4.695,0.09,0.02,1.87,0.11,0
  73. 4,29.48,31.513,4.63,0.08,0.01,1.97,0.16,0
  74. 6,29.61,33.393,4.61,0.15,0.02,2.21,0.16,0
  75. 7,29.59,33.937,4.611,0.09,0.02,2.39,0.21,0
  76. 10,29.12,34.414,4.58,0.05,0.02,2.39,0.21,0
  77.  
  78.      Your header file HEAD.DOC would look like this,
  79.  
  80. Nutrient Data from the Northern Gulf of Mexico.
  81. =======================================================================
  82.        Potent.
  83.  Depth   Temp.    Sal.     O2     NH4     PO4      Si     NO3     NO2
  84. -----------------------------------------------------------------------
  85.  
  86.      If you chose to produce a space-delimited data file, it would look like 
  87. this,
  88.  
  89. 2 29.48 30.287 4.695 0.09 0.02 1.87 0.11 0
  90. 4 29.48 31.513 4.63 0.08 0.01 1.97 0.16 0
  91. 6 29.61 33.393 4.61 0.15 0.02 2.21 0.16 0
  92. 7 29.59 33.937 4.611 0.09 0.02 2.39 0.21 0
  93. 10 29.12 34.414 4.58 0.05 0.02 2.39 0.21 0
  94.  
  95.  
  96.      Using the -t switch for an original tabular data form, you'd get this,
  97.  
  98.      2    29.48  30.287   4.695    0.09    0.02    1.87    0.11       0
  99.      4    29.48  31.513    4.63    0.08    0.01    1.97    0.16       0
  100.      6    29.61  33.393    4.61    0.15    0.02    2.21    0.16       0
  101.      7    29.59  33.937   4.611    0.09    0.02    2.39    0.21       0
  102.     10    29.12  34.414    4.58    0.05    0.02    2.39    0.21       0
  103.  
  104.      You may distribute this program, provided you do not charge for 
  105. it, and all files remain intact.  Following is a CRC check for 
  106. NOHEAD.EXE v1.0:
  107.  
  108.   FILE                                  CRC     LENGTH      DATE
  109.   ====                                  ===     ======      ====
  110. NOHEAD.EXE                             34129     16865     1/5/92
  111.  
  112.      If you'd like this program for work in another environment, or if 
  113. you have comments, suggestions or questions, you may contact me by 
  114. modem on COASTAL RBBS at 305 361-4524 (300 to 19,200 baud, 8/N/1), or, 
  115. write to me at:
  116.  
  117. Jim Hendee
  118. 1301 SE 5 Avenue
  119. Pompano Beach, FL  33060
  120.  
  121.